import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { GraphService } from './util/graph.service';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.less']
})
export class AppComponent implements OnInit {
  miniMapStatus = true;

  @ViewChild('graphContainer', { static: true }) private containerRef!: ElementRef;
  @ViewChild('minimap', { static: true }) private minimapContainer!: ElementRef;

  constructor(
    private graphService: GraphService,
  ) {

  }

  ngOnInit(): void {
    this.graphService.setAnchor(this.containerRef, this.minimapContainer);

    this.graphService.minMapBtn$.subscribe((status) => {
      console.log('min::', status);
      this.miniMapStatus = status;
    });
  }

}
